define(['artTemplate' , 'modalMobile' , '../../common/ajax/ajax' , '../../../common/js/lib/text!../../../tpl/advanced-setting.tpl' , '../../../common/js/lib/text!../../../tpl/footer.tpl'] ,
function (artTemplate , modalMobile , ajax , advancedSettingTpl , footerTpl){
  return function(){
    var footer = artTemplate.compile(footerTpl)({type:4}),
        host = window.location.host == '10.0.0.1',
        advancedSetting = artTemplate.compile(advancedSettingTpl)({host:host});
    $('.webApp-content').html(advancedSetting+footer);
    //重启
    $('.reBoot-btn').click(function(){
      var $barLength = $('.bar-length');
      modalMobile.alert('是否确定恢复设备' , {
        title:'提示',
        yesBack(){
          $('.reBoot-box').show();
          ajax({
              url:interfaces.restore_router.url,
              dataType:interfaces.restore_router.dataType,
              type:interfaces.restore_router.type,
              cache:{
                  use:false,
                  name:'',
                  time:10
              },
              isOk:function(data){
                if(useNetData){
                  data = data;
                }else{
                  data = data.hostLocation;
                };
              }
          });
          var w = 0;
          var time = setInterval(function(){
            w += 1.25;
            $barLength.width(w+'%');
            if(w >= 100){
              //测试
              clearInterval(time);
              window.location.href = '/h5-wizard/index.html#system-info';
            };
          } , 1000);
        },
        btn:['取消' , '确定']
      });
    });
  }
});
